namespace SharpObjects.Multithreading_Test
{
    public class ThreadContext
    {
        private int count = 0;

        public string Label { get; set; }

        public int GetAndIncrementCount()
        {
            lock(this)
            {
               return this.count++;                    
            }
        }
    }
}